package com.qidianit.mes.sys.controller;

import com.github.pagehelper.PageInfo;
import com.qidianit.mes.pojo.Material;
import com.qidianit.mes.pojo.MaterialBom;
import com.qidianit.mes.pojo.Result;
import com.qidianit.mes.sys.service.MaterialBomService;
import com.qidianit.mes.sys.vo.MaterialBomUtilCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Description:
 * @Author: shanzhe
 * @Date: 2025/9/23 - 11:30
 */
@RestController
@RequestMapping("/materialBom")
public class MaterialBomController {

    @Autowired
    private MaterialBomService materialBomService;

    @GetMapping("/list")
    public Result<PageInfo<MaterialBomUtilCategory>> selectMaterialBomByParentMaterialId(@RequestParam(value = "pageNum",defaultValue = "1") Integer pageNum,
                                                                                         @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
                                                                                         @RequestParam("parentMaterialId") Long parentMaterialId) {
        return Result.success(materialBomService.selectMaterialBomByParentMaterialId(pageNum,pageSize,parentMaterialId));
    }
}
